﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;

namespace Poly2Tri
{
	// Token: 0x02000413 RID: 1043
	public class Point2DList : IEnumerable<Point2D>, IList<Point2D>, IEnumerable, ICollection<Point2D>
	{
		// Token: 0x06001D59 RID: 7513 RVA: 0x000B4E5C File Offset: 0x000B305C
		public Point2DList()
		{
		}

		// Token: 0x06001D5A RID: 7514 RVA: 0x000B4E8C File Offset: 0x000B308C
		public Point2DList(int capacity)
		{
			this.mPoints.Capacity = capacity;
		}

		// Token: 0x06001D5B RID: 7515 RVA: 0x000B4EC8 File Offset: 0x000B30C8
		public Point2DList(IList<Point2D> l)
		{
			this.AddRange(l.GetEnumerator(), Point2DList.WindingOrderType.Unknown);
		}

		// Token: 0x06001D5C RID: 7516 RVA: 0x000B4F08 File Offset: 0x000B3108
		public Point2DList(Point2DList l)
		{
			int count = l.Count;
			for (int i = 0; i < count; i++)
			{
				this.mPoints.Add(l[i]);
			}
			this.mBoundingBox.Set(l.BoundingBox);
			this.mEpsilon = l.Epsilon;
			this.mWindingOrder = l.WindingOrder;
		}

		// Token: 0x17000431 RID: 1073
		// (get) Token: 0x06001D5D RID: 7517 RVA: 0x000AEDFC File Offset: 0x000ACFFC
		public Rect2D BoundingBox
		{
			get
			{
				return this.mBoundingBox;
			}
		}

		// Token: 0x17000432 RID: 1074
		// (get) Token: 0x06001D5E RID: 7518 RVA: 0x000B4F97 File Offset: 0x000B3197
		// (set) Token: 0x06001D5F RID: 7519 RVA: 0x000B4F9F File Offset: 0x000B319F
		public Point2DList.WindingOrderType WindingOrder
		{
			get
			{
				return this.mWindingOrder;
			}
			set
			{
				if (this.mWindingOrder == Point2DList.WindingOrderType.Unknown)
				{
					this.mWindingOrder = this.CalculateWindingOrder();
				}
				if (value != this.mWindingOrder)
				{
					this.mPoints.Reverse();
					this.mWindingOrder = value;
				}
			}
		}

		// Token: 0x17000433 RID: 1075
		// (get) Token: 0x06001D60 RID: 7520 RVA: 0x000B4FD7 File Offset: 0x000B31D7
		public double Epsilon
		{
			get
			{
				return this.mEpsilon;
			}
		}

		// Token: 0x17000434 RID: 1076
		public Point2D this[int index]
		{
			get
			{
				return this.mPoints[index];
			}
			set
			{
				this.mPoints[index] = value;
			}
		}

		// Token: 0x17000435 RID: 1077
		// (get) Token: 0x06001D63 RID: 7523 RVA: 0x000B4FED File Offset: 0x000B31ED
		public int Count
		{
			get
			{
				return this.mPoints.Count;
			}
		}

		// Token: 0x17000436 RID: 1078
		// (get) Token: 0x06001D64 RID: 7524 RVA: 0x0001D4CA File Offset: 0x0001B6CA
		public virtual bool IsReadOnly
		{
			get
			{
				return false;
			}
		}

		// Token: 0x06001D65 RID: 7525 RVA: 0x000B4FFC File Offset: 0x000B31FC
		public override string ToString()
		{
			StringBuilder stringBuilder = new StringBuilder();
			for (int i = 0; i < this.Count; i++)
			{
				stringBuilder.Append(this[i].ToString());
				if (i < this.Count - 1)
				{
					stringBuilder.Append(" ");
				}
			}
			return stringBuilder.ToString();
		}

		// Token: 0x06001D66 RID: 7526 RVA: 0x000B5059 File Offset: 0x000B3259
		IEnumerator IEnumerable.GetEnumerator()
		{
			return this.mPoints.GetEnumerator();
		}

		// Token: 0x06001D67 RID: 7527 RVA: 0x000B506B File Offset: 0x000B326B
		IEnumerator<Point2D> IEnumerable<Point2D>.GetEnumerator()
		{
			return new Point2DEnumerator(this.mPoints);
		}

		// Token: 0x06001D68 RID: 7528 RVA: 0x000B5078 File Offset: 0x000B3278
		public void Clear()
		{
			this.mPoints.Clear();
			this.mBoundingBox.Clear();
			this.mEpsilon = MathUtil.EPSILON;
			this.mWindingOrder = Point2DList.WindingOrderType.Unknown;
		}

		// Token: 0x06001D69 RID: 7529 RVA: 0x000AEE29 File Offset: 0x000AD029
		public int IndexOf(Point2D p)
		{
			return this.mPoints.IndexOf(p);
		}

		// Token: 0x06001D6A RID: 7530 RVA: 0x000AEE37 File Offset: 0x000AD037
		public virtual void Add(Point2D p)
		{
			this.Add(p, -1, true);
		}

		// Token: 0x06001D6B RID: 7531 RVA: 0x000B50A4 File Offset: 0x000B32A4
		protected virtual void Add(Point2D p, int idx, bool bCalcWindingOrderAndEpsilon)
		{
			if (idx < 0)
			{
				this.mPoints.Add(p);
			}
			else
			{
				this.mPoints.Insert(idx, p);
			}
			this.mBoundingBox.AddPoint(p);
			if (bCalcWindingOrderAndEpsilon)
			{
				if (this.mWindingOrder == Point2DList.WindingOrderType.Unknown)
				{
					this.mWindingOrder = this.CalculateWindingOrder();
				}
				this.mEpsilon = this.CalculateEpsilon();
			}
		}

		// Token: 0x06001D6C RID: 7532 RVA: 0x000B510C File Offset: 0x000B330C
		public virtual void AddRange(Point2DList l)
		{
			this.AddRange(l.mPoints.GetEnumerator(), l.WindingOrder);
		}

		// Token: 0x06001D6D RID: 7533 RVA: 0x000B512C File Offset: 0x000B332C
		public virtual void AddRange(IEnumerator<Point2D> iter, Point2DList.WindingOrderType windingOrder)
		{
			if (iter == null)
			{
				return;
			}
			if (this.mWindingOrder == Point2DList.WindingOrderType.Unknown && this.Count == 0)
			{
				this.mWindingOrder = windingOrder;
			}
			bool flag = this.WindingOrder != Point2DList.WindingOrderType.Unknown && windingOrder != Point2DList.WindingOrderType.Unknown && this.WindingOrder != windingOrder;
			bool flag2 = true;
			int count = this.mPoints.Count;
			iter.Reset();
			while (iter.MoveNext())
			{
				if (!flag2)
				{
					flag2 = true;
					this.mPoints.Add(iter.Current);
				}
				else if (flag)
				{
					this.mPoints.Insert(count, iter.Current);
				}
				else
				{
					this.mPoints.Add(iter.Current);
				}
				this.mBoundingBox.AddPoint(iter.Current);
			}
			if (this.mWindingOrder == Point2DList.WindingOrderType.Unknown && windingOrder == Point2DList.WindingOrderType.Unknown)
			{
				this.mWindingOrder = this.CalculateWindingOrder();
			}
			this.mEpsilon = this.CalculateEpsilon();
		}

		// Token: 0x06001D6E RID: 7534 RVA: 0x000AF0CC File Offset: 0x000AD2CC
		public virtual void Insert(int idx, Point2D item)
		{
			this.Add(item, idx, true);
		}

		// Token: 0x06001D6F RID: 7535 RVA: 0x000B522D File Offset: 0x000B342D
		public virtual bool Remove(Point2D p)
		{
			if (this.mPoints.Remove(p))
			{
				this.CalculateBounds();
				this.mEpsilon = this.CalculateEpsilon();
				return true;
			}
			return false;
		}

		// Token: 0x06001D70 RID: 7536 RVA: 0x000B5255 File Offset: 0x000B3455
		public virtual void RemoveAt(int idx)
		{
			if (idx < 0 || idx >= this.Count)
			{
				return;
			}
			this.mPoints.RemoveAt(idx);
			this.CalculateBounds();
			this.mEpsilon = this.CalculateEpsilon();
		}

		// Token: 0x06001D71 RID: 7537 RVA: 0x000B5289 File Offset: 0x000B3489
		public virtual void RemoveRange(int idxStart, int count)
		{
			if (idxStart < 0 || idxStart >= this.Count)
			{
				return;
			}
			if (count == 0)
			{
				return;
			}
			this.mPoints.RemoveRange(idxStart, count);
			this.CalculateBounds();
			this.mEpsilon = this.CalculateEpsilon();
		}

		// Token: 0x06001D72 RID: 7538 RVA: 0x000AF0E0 File Offset: 0x000AD2E0
		public bool Contains(Point2D p)
		{
			return this.mPoints.Contains(p);
		}

		// Token: 0x06001D73 RID: 7539 RVA: 0x000B52C8 File Offset: 0x000B34C8
		public void CopyTo(Point2D[] array, int arrayIndex)
		{
			int num = Math.Min(this.Count, array.Length - arrayIndex);
			for (int i = 0; i < num; i++)
			{
				array[arrayIndex + i] = this.mPoints[i];
			}
		}

		// Token: 0x06001D74 RID: 7540 RVA: 0x000B530C File Offset: 0x000B350C
		public void CalculateBounds()
		{
			this.mBoundingBox.Clear();
			foreach (Point2D p in this.mPoints)
			{
				this.mBoundingBox.AddPoint(p);
			}
		}

		// Token: 0x06001D75 RID: 7541 RVA: 0x000B5378 File Offset: 0x000B3578
		public double CalculateEpsilon()
		{
			return Math.Max(Math.Min(this.mBoundingBox.Width, this.mBoundingBox.Height) * 0.001, MathUtil.EPSILON);
		}

		// Token: 0x06001D76 RID: 7542 RVA: 0x000B53AC File Offset: 0x000B35AC
		public Point2DList.WindingOrderType CalculateWindingOrder()
		{
			double signedArea = this.GetSignedArea();
			if (signedArea < 0.0)
			{
				return Point2DList.WindingOrderType.CW;
			}
			if (signedArea > 0.0)
			{
				return Point2DList.WindingOrderType.CCW;
			}
			return Point2DList.WindingOrderType.Unknown;
		}

		// Token: 0x06001D77 RID: 7543 RVA: 0x000B53E3 File Offset: 0x000B35E3
		public int NextIndex(int index)
		{
			if (index == this.Count - 1)
			{
				return 0;
			}
			return index + 1;
		}

		// Token: 0x06001D78 RID: 7544 RVA: 0x000B53F8 File Offset: 0x000B35F8
		public int PreviousIndex(int index)
		{
			if (index == 0)
			{
				return this.Count - 1;
			}
			return index - 1;
		}

		// Token: 0x06001D79 RID: 7545 RVA: 0x000B540C File Offset: 0x000B360C
		public double GetSignedArea()
		{
			double num = 0.0;
			for (int i = 0; i < this.Count; i++)
			{
				int index = (i + 1) % this.Count;
				num += this[i].X * this[index].Y;
				num -= this[i].Y * this[index].X;
			}
			return num / 2.0;
		}

		// Token: 0x06001D7A RID: 7546 RVA: 0x000B548C File Offset: 0x000B368C
		public double GetArea()
		{
			double num = 0.0;
			for (int i = 0; i < this.Count; i++)
			{
				int index = (i + 1) % this.Count;
				num += this[i].X * this[index].Y;
				num -= this[i].Y * this[index].X;
			}
			num /= 2.0;
			return (num >= 0.0) ? num : (-num);
		}

		// Token: 0x06001D7B RID: 7547 RVA: 0x000B5520 File Offset: 0x000B3720
		public Point2D GetCentroid()
		{
			Point2D lhs = new Point2D();
			double num = 0.0;
			Point2D point2D = new Point2D();
			for (int i = 0; i < this.Count; i++)
			{
				Point2D point2D2 = point2D;
				Point2D point2D3 = this[i];
				Point2D point2D4 = (i + 1 >= this.Count) ? this[0] : this[i + 1];
				Point2D lhs2 = point2D3 - point2D2;
				Point2D rhs = point2D4 - point2D2;
				double num2 = Point2D.Cross(lhs2, rhs);
				double num3 = 0.5 * num2;
				num += num3;
				lhs += num3 * 0.3333333333333333 * (point2D2 + point2D3 + point2D4);
			}
			return lhs * (1.0 / num);
		}

		// Token: 0x06001D7C RID: 7548 RVA: 0x000B55FC File Offset: 0x000B37FC
		public void Translate(Point2D vector)
		{
			for (int i = 0; i < this.Count; i++)
			{
				int index;
				this[index = i] = this[index] + vector;
			}
		}

		// Token: 0x06001D7D RID: 7549 RVA: 0x000B5638 File Offset: 0x000B3838
		public void Scale(Point2D value)
		{
			for (int i = 0; i < this.Count; i++)
			{
				int index;
				this[index = i] = this[index] * value;
			}
		}

		// Token: 0x06001D7E RID: 7550 RVA: 0x000B5674 File Offset: 0x000B3874
		public void Rotate(double radians)
		{
			double num = Math.Cos(radians);
			double num2 = Math.Sin(radians);
			foreach (Point2D point2D in this.mPoints)
			{
				double x = point2D.X;
				point2D.X = x * num - point2D.Y * num2;
				point2D.Y = x * num2 + point2D.Y * num;
			}
		}

		// Token: 0x06001D7F RID: 7551 RVA: 0x000B5708 File Offset: 0x000B3908
		public bool IsDegenerate()
		{
			if (this.Count < 3)
			{
				return false;
			}
			if (this.Count < 3)
			{
				return false;
			}
			for (int i = 0; i < this.Count; i++)
			{
				int index = this.PreviousIndex(i);
				if (this.mPoints[index].Equals(this.mPoints[i], this.Epsilon))
				{
					return true;
				}
				int index2 = this.PreviousIndex(index);
				Orientation orientation = TriangulationUtil.Orient2d(this.mPoints[index2], this.mPoints[index], this.mPoints[i]);
				if (orientation == Orientation.Collinear)
				{
					return true;
				}
			}
			return false;
		}

		// Token: 0x06001D80 RID: 7552 RVA: 0x000B57B8 File Offset: 0x000B39B8
		public bool IsConvex()
		{
			bool flag = false;
			for (int i = 0; i < this.Count; i++)
			{
				int index = (i != 0) ? (i - 1) : (this.Count - 1);
				int index2 = i;
				int index3 = (i != this.Count - 1) ? (i + 1) : 0;
				double num = this[index2].X - this[index].X;
				double num2 = this[index2].Y - this[index].Y;
				double num3 = this[index3].X - this[index2].X;
				double num4 = this[index3].Y - this[index2].Y;
				double num5 = num * num4 - num3 * num2;
				bool flag2 = num5 >= 0.0;
				if (i == 0)
				{
					flag = flag2;
				}
				else if (flag != flag2)
				{
					return false;
				}
			}
			return true;
		}

		// Token: 0x06001D81 RID: 7553 RVA: 0x000B58C0 File Offset: 0x000B3AC0
		public bool IsSimple()
		{
			for (int i = 0; i < this.Count; i++)
			{
				int index = this.NextIndex(i);
				for (int j = i + 1; j < this.Count; j++)
				{
					int index2 = this.NextIndex(j);
					Point2D point2D = null;
					if (TriangulationUtil.LinesIntersect2D(this.mPoints[i], this.mPoints[index], this.mPoints[j], this.mPoints[index2], ref point2D, this.mEpsilon))
					{
						return false;
					}
				}
			}
			return true;
		}

		// Token: 0x06001D82 RID: 7554 RVA: 0x000B5958 File Offset: 0x000B3B58
		public Point2DList.PolygonError CheckPolygon()
		{
			Point2DList.PolygonError polygonError = Point2DList.PolygonError.None;
			if (this.Count < 3 || this.Count > Point2DList.kMaxPolygonVertices)
			{
				return polygonError | Point2DList.PolygonError.NotEnoughVertices;
			}
			if (this.IsDegenerate())
			{
				polygonError |= Point2DList.PolygonError.Degenerate;
			}
			if (!this.IsSimple())
			{
				polygonError |= Point2DList.PolygonError.NotSimple;
			}
			if (this.GetArea() < MathUtil.EPSILON)
			{
				polygonError |= Point2DList.PolygonError.AreaTooSmall;
			}
			if ((polygonError & Point2DList.PolygonError.NotSimple) != Point2DList.PolygonError.NotSimple)
			{
				bool flag = false;
				Point2DList.WindingOrderType windingOrder = Point2DList.WindingOrderType.CCW;
				Point2DList.WindingOrderType windingOrderType = Point2DList.WindingOrderType.CW;
				if (this.WindingOrder == windingOrderType)
				{
					this.WindingOrder = windingOrder;
					flag = true;
				}
				Point2D[] array = new Point2D[this.Count];
				Point2DList point2DList = new Point2DList(this.Count);
				for (int i = 0; i < this.Count; i++)
				{
					point2DList.Add(new Point2D(this[i].X, this[i].Y));
					int index = i;
					int index2 = this.NextIndex(i);
					Point2D lhs = new Point2D(this[index2].X - this[index].X, this[index2].Y - this[index].Y);
					array[i] = Point2D.Perpendicular(lhs, 1.0);
					array[i].Normalize();
				}
				for (int j = 0; j < this.Count; j++)
				{
					int num = this.PreviousIndex(j);
					double num2 = Point2D.Cross(array[num], array[j]);
					num2 = MathUtil.Clamp(num2, -1.0, 1.0);
					float value = (float)Math.Asin(num2);
					if ((double)Math.Abs(value) <= Point2DList.kAngularSlop)
					{
						polygonError |= Point2DList.PolygonError.SidesTooCloseToParallel;
						break;
					}
				}
				if (flag)
				{
					this.WindingOrder = windingOrderType;
				}
			}
			return polygonError;
		}

		// Token: 0x06001D83 RID: 7555 RVA: 0x000B5B2C File Offset: 0x000B3D2C
		public static string GetErrorString(Point2DList.PolygonError error)
		{
			StringBuilder stringBuilder = new StringBuilder(256);
			if (error == Point2DList.PolygonError.None)
			{
				stringBuilder.AppendFormat("No errors.\n", new object[0]);
			}
			else
			{
				if ((error & Point2DList.PolygonError.NotEnoughVertices) == Point2DList.PolygonError.NotEnoughVertices)
				{
					stringBuilder.AppendFormat("NotEnoughVertices: must have between 3 and {0} vertices.\n", Point2DList.kMaxPolygonVertices);
				}
				if ((error & Point2DList.PolygonError.NotConvex) == Point2DList.PolygonError.NotConvex)
				{
					stringBuilder.AppendFormat("NotConvex: Polygon is not convex.\n", new object[0]);
				}
				if ((error & Point2DList.PolygonError.NotSimple) == Point2DList.PolygonError.NotSimple)
				{
					stringBuilder.AppendFormat("NotSimple: Polygon is not simple (i.e. it intersects itself).\n", new object[0]);
				}
				if ((error & Point2DList.PolygonError.AreaTooSmall) == Point2DList.PolygonError.AreaTooSmall)
				{
					stringBuilder.AppendFormat("AreaTooSmall: Polygon's area is too small.\n", new object[0]);
				}
				if ((error & Point2DList.PolygonError.SidesTooCloseToParallel) == Point2DList.PolygonError.SidesTooCloseToParallel)
				{
					stringBuilder.AppendFormat("SidesTooCloseToParallel: Polygon's sides are too close to parallel.\n", new object[0]);
				}
				if ((error & Point2DList.PolygonError.TooThin) == Point2DList.PolygonError.TooThin)
				{
					stringBuilder.AppendFormat("TooThin: Polygon is too thin or core shape generation would move edge past centroid.\n", new object[0]);
				}
				if ((error & Point2DList.PolygonError.Degenerate) == Point2DList.PolygonError.Degenerate)
				{
					stringBuilder.AppendFormat("Degenerate: Polygon is degenerate (contains collinear points or duplicate coincident points).\n", new object[0]);
				}
				if ((error & Point2DList.PolygonError.Unknown) == Point2DList.PolygonError.Unknown)
				{
					stringBuilder.AppendFormat("Unknown: Unknown Polygon error!.\n", new object[0]);
				}
			}
			return stringBuilder.ToString();
		}

		// Token: 0x06001D84 RID: 7556 RVA: 0x000B5C54 File Offset: 0x000B3E54
		public void RemoveDuplicateNeighborPoints()
		{
			int num = this.Count;
			int num2 = num - 1;
			int num3 = 0;
			while (num > 1 && num3 < num)
			{
				if (this.mPoints[num2].Equals(this.mPoints[num3]))
				{
					int index = Math.Max(num2, num3);
					this.mPoints.RemoveAt(index);
					num--;
					if (num2 >= num)
					{
						num2 = num - 1;
					}
				}
				else
				{
					num2 = this.NextIndex(num2);
					num3++;
				}
			}
		}

		// Token: 0x06001D85 RID: 7557 RVA: 0x000B5CD7 File Offset: 0x000B3ED7
		public void Simplify()
		{
			this.Simplify(0.0);
		}

		// Token: 0x06001D86 RID: 7558 RVA: 0x000B5CE8 File Offset: 0x000B3EE8
		public void Simplify(double bias)
		{
			if (this.Count < 3)
			{
				return;
			}
			int num = 0;
			int num2 = this.Count;
			double num3 = bias * bias;
			while (num < num2 && num2 >= 3)
			{
				int index = this.PreviousIndex(num);
				int index2 = this.NextIndex(num);
				Point2D point2D = this[index];
				Point2D point2D2 = this[num];
				Point2D pc = this[index2];
				if ((point2D - point2D2).MagnitudeSquared() <= num3)
				{
					this.RemoveAt(num);
					num2--;
				}
				else
				{
					Orientation orientation = TriangulationUtil.Orient2d(point2D, point2D2, pc);
					if (orientation == Orientation.Collinear)
					{
						this.RemoveAt(num);
						num2--;
					}
					else
					{
						num++;
					}
				}
			}
		}

		// Token: 0x06001D87 RID: 7559 RVA: 0x000B5D9C File Offset: 0x000B3F9C
		public void MergeParallelEdges(double tolerance)
		{
			if (this.Count <= 3)
			{
				return;
			}
			bool[] array = new bool[this.Count];
			int num = this.Count;
			for (int i = 0; i < this.Count; i++)
			{
				int index = (i != 0) ? (i - 1) : (this.Count - 1);
				int index2 = i;
				int index3 = (i != this.Count - 1) ? (i + 1) : 0;
				double num2 = this[index2].X - this[index].X;
				double num3 = this[index2].Y - this[index].Y;
				double num4 = this[index3].Y - this[index2].X;
				double num5 = this[index3].Y - this[index2].Y;
				double num6 = Math.Sqrt(num2 * num2 + num3 * num3);
				double num7 = Math.Sqrt(num4 * num4 + num5 * num5);
				if ((num6 <= 0.0 || num7 <= 0.0) && num > 3)
				{
					array[i] = true;
					num--;
				}
				num2 /= num6;
				num3 /= num6;
				num4 /= num7;
				num5 /= num7;
				double value = num2 * num5 - num4 * num3;
				double num8 = num2 * num4 + num3 * num5;
				if (Math.Abs(value) < tolerance && num8 > 0.0 && num > 3)
				{
					array[i] = true;
					num--;
				}
				else
				{
					array[i] = false;
				}
			}
			if (num == this.Count || num == 0)
			{
				return;
			}
			int num9 = 0;
			Point2DList point2DList = new Point2DList(this);
			this.Clear();
			for (int j = 0; j < point2DList.Count; j++)
			{
				if (!array[j] && num != 0 && num9 != num)
				{
					if (num9 >= num)
					{
						throw new Exception(string.Concat(new object[]
						{
							"Point2DList::MergeParallelEdges - currIndex[ ",
							num9.ToString(),
							"] >= newNVertices[",
							num,
							"]"
						}));
					}
					this.mPoints.Add(point2DList[j]);
					this.mBoundingBox.AddPoint(point2DList[j]);
					num9++;
				}
			}
			this.mWindingOrder = this.CalculateWindingOrder();
			this.mEpsilon = this.CalculateEpsilon();
		}

		// Token: 0x06001D88 RID: 7560 RVA: 0x000B6030 File Offset: 0x000B4230
		public void ProjectToAxis(Point2D axis, out double min, out double max)
		{
			double num = Point2D.Dot(axis, this[0]);
			min = num;
			max = num;
			for (int i = 0; i < this.Count; i++)
			{
				num = Point2D.Dot(this[i], axis);
				if (num < min)
				{
					min = num;
				}
				else if (num > max)
				{
					max = num;
				}
			}
		}

		// Token: 0x04001DC5 RID: 7621
		public static readonly int kMaxPolygonVertices = 100000;

		// Token: 0x04001DC6 RID: 7622
		public static readonly double kLinearSlop = 0.005;

		// Token: 0x04001DC7 RID: 7623
		public static readonly double kAngularSlop = 0.0035367765131532297;

		// Token: 0x04001DC8 RID: 7624
		protected List<Point2D> mPoints = new List<Point2D>();

		// Token: 0x04001DC9 RID: 7625
		protected Rect2D mBoundingBox = new Rect2D();

		// Token: 0x04001DCA RID: 7626
		protected Point2DList.WindingOrderType mWindingOrder = Point2DList.WindingOrderType.Unknown;

		// Token: 0x04001DCB RID: 7627
		protected double mEpsilon = MathUtil.EPSILON;

		// Token: 0x02000414 RID: 1044
		public enum WindingOrderType
		{
			// Token: 0x04001DCD RID: 7629
			CW,
			// Token: 0x04001DCE RID: 7630
			CCW,
			// Token: 0x04001DCF RID: 7631
			Unknown,
			// Token: 0x04001DD0 RID: 7632
			Default = 1
		}

		// Token: 0x02000415 RID: 1045
		[Flags]
		public enum PolygonError : uint
		{
			// Token: 0x04001DD2 RID: 7634
			None = 0U,
			// Token: 0x04001DD3 RID: 7635
			NotEnoughVertices = 1U,
			// Token: 0x04001DD4 RID: 7636
			NotConvex = 2U,
			// Token: 0x04001DD5 RID: 7637
			NotSimple = 4U,
			// Token: 0x04001DD6 RID: 7638
			AreaTooSmall = 8U,
			// Token: 0x04001DD7 RID: 7639
			SidesTooCloseToParallel = 16U,
			// Token: 0x04001DD8 RID: 7640
			TooThin = 32U,
			// Token: 0x04001DD9 RID: 7641
			Degenerate = 64U,
			// Token: 0x04001DDA RID: 7642
			Unknown = 1073741824U
		}
	}
}
